import 'dart:async';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:wheel_picker/wheel_picker.dart';

class WheelPickerExample extends StatelessWidget {
  const WheelPickerExample({super.key});




  @override
  Widget build(BuildContext context) {
    final secondsWheel = WheelPickerController(itemCount: 10);
    const textStyle = TextStyle(fontSize: 32.0, height: 1.5);
    const daysOfWeek = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];

    // Timer.periodic(const Duration(seconds: 1), (_) => secondsWheel.shiftDown());

    return Row(
      children: [
        Expanded(
          child: WheelPicker(
            builder: (context, index) => Text("$index", style: textStyle),
            controller: secondsWheel,
            selectedIndexColor: Colors.blue,
            onIndexChanged: (index, interactionType) => print("On index $index"),
            style: WheelPickerStyle(
              itemExtent: textStyle.fontSize! * textStyle.height!, // Text height
              squeeze: 1.25,
              diameterRatio: .8,
              surroundingOpacity: .25,
              magnification: 1.2,
            ),
          ),
        ),


      Expanded(
        child: WheelPicker(
          itemCount: 7,
          builder: (context, index) => Text(daysOfWeek[index]),
          selectedIndexColor: Colors.orange,
          looping: true,
          style: WheelPickerStyle(
            itemExtent: textStyle.fontSize! * textStyle.height!, // Text height
            squeeze: 1.25,
            diameterRatio: .8,
            surroundingOpacity: .25,
            magnification: 1.2,
          ),
        ),
      ),

      ],
    );
  }
}